Node.js npm과 같이 Python에도 pip라는 좋은 패키지관리툴이 있다. 프로젝트마다 동일한 패키지를 관리할 수 있는 방법에 대해서 알아보자 $ pip freeze > requirements.txt Django==2.2 django-rest-swagger==2.2.0 djangorestframework==3.11.0 ... freeze 명령어 사용시 pip에 설치되어있는 목록이 requirements.txt 파일에 저장된다. 파일명은 requirements.txt로 해야할 필요는 없다. 예시일뿐. 저장된 내용대로 설치하기 위해선 pip install -r requirements.txt 해당 명령어로 실행시 동일한 패키지와 버전으로 설치되는 것을 확인 할 수있다. 위와 같은 방법으로 환경에 맞게 ..
터미널에서 API에 간단하게 질의할 때 보통 curl을 많이 사용했는데, 단순하게 결과만 나오는 부분에서 아쉬운 점이 있었다. 이번에 파이썬을 공부하다 보니 Django에서 공식페이지에서 HTTP로 커맨드 하는 부분이 있어 찾아보았다. Response 뿐만 아니라 헤더 정보와 http 상태도 같이 볼 수 있어 괜찮은 것 같다. 보통 윈도우나, 맥os 만 공식적으로 지원하는 부분이 많은데 리눅스까지 지원해 주는 부분도 인상적이다. 사용방법은 간단하다 설치하고 터미널에서 http로 질의하면 끝. 설치하기 맥os brew install httpie 윈도우 # Make sure we have an up-to-date version of pip and setuptools: pip install --upgrade ..
환경설정 1.1. 기본구성 pip >= 19.0.3 python >= 3.4 (django 2.2 지원 최소버전) # pip upgrade last version pip install --upgrade pip # check pip version pip --version pip 19.0.3 from /Users/.../pip-19.0.3-py3.7.egg/pip (python 3.7) 1.2. install django pip install django==2.2 pip install djangorestframework==3.11.0 $ django-admin startprject {project_name} $ ls {project_name}/ # django server start $ .manage.py ..
api.py from flask import Flask from flask_restful import Resource, Api app = Flask(__name__) api = Api(app) class HelloWorld(Resource): def get(self): return {'hello': 'world'} api.add_resource(HelloWorld, '/') if __name__ == '__main__': app.run(debug=True) 실행하기 $ python api.py * Running on http://127.0.0.1:5000/ * Restarting with reloader #파이참 사용시 .html 사용으로 rest api test 할 수 있다. # helloworld.h..
https://www.phpliveregex.com/#tab-preg-match PHP Live Regex i case insensitive m treat as multi-line string s dot matches newline x ignore whitespace in regex A matches only at the start of string D matches only at the end of string U non-greedy matching by default www.phpliveregex.com
맥os 카탈리나부터 기본 쉘이 zsh로 바뀌면서 기존에 잘 사용했던 home, end키가 먹히지 않는다. 생각없이 사용하고 있다 안되니 불편하구만 특이하게 vim이나 다른 곳에서는 사용이 가능한게 zsh에서 안되는 것 같아 찾아보니 비슷한 증상으로 해결방법이 있다. zshrc에 아래 코드 입력해주면 정상적으로 사용할 수 있다. vi ~/.zshrc #home end 안될 때 bindkey "\033[1~" beginning-of-line bindkey "\033[4~" end-of-line https://yumere.tistory.com/95 zsh, oh-my-zsh에서 home/end 키가 안될 때 그냥 개인 기록용... 환경: Ubuntu 16.04 Xshell 을 이용한 ssh 연결 zsh she..
https://www.lesstif.com/dbms/mysql-client-query-csv-text-54951965.html MySQL client query 결과를 csv 나 text 파일로 저장 ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement www.lesstif.com SELECT order_id,product_name,qty FROM orders INTO OUTFILE '/tmp/orders.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' 파일 생성은 된 ..
- Total
- Today
- Yesterday
- vim
- laravel-test
- 라라벨
- php-composer
- POP3
- django
- php
- composite-primarykey
- 테스트_다중트랜잭션
- 자바스크립트
- exception-test
- Laravel
- composer-install
- graphql-php
- eloquant
- session+token authorize
- php-laravel
- 정의
- 나는욕심쟁이
- Python
- 둘이상인증한번에사용하기
- 메일
- addMonth
- redis
- addMonthWithoutOverflow
- MySQL
- VIM-COMMAND
- 정규식
- composer-self-update
- graphql